import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'package:path_provider/path_provider.dart';
import 'dart:io' show File;
import 'dart:async' show Future;

/// 创建原生数据库连接
Future<DatabaseConnection> createNativeDatabase() async {
  final dbFolder = await getApplicationDocumentsDirectory();
  final file = File('${dbFolder.path}/flowplan.sqlite');
  return DatabaseConnection(NativeDatabase.createInBackground(file));
}

/// 创建数据库连接（用于条件导入）
Future<DatabaseConnection> createDatabaseConnection() async {
  final dbFolder = await getApplicationDocumentsDirectory();
  final file = File('${dbFolder.path}/flowplan.sqlite');
  return DatabaseConnection(NativeDatabase.createInBackground(file));
}
